@extends('layout.admin') 

@section('content')
<div class="container">
	<div class="row">
        <div class="span2">
            <div class="well sidebar-nav">
                <ul class="nav nav-list">
                  <li class="nav-header">菜单</li>
                  <li><a href="{{URL::to('admin/post')}}"><i class="icon-th-list"></i> 日志列表</a></li>
                  <li><a href="{{URL::to('admin/post/create')}}"><i class="icon-pencil"></i> 添加日志</a></li>
                  <li class="active"><a href="{{URL::to('admin/posttype')}}"><i class="icon-th-list"></i>
							日志类型</a></li>
					<li><a href="{{URL::to('admin/posttype/create')}}"><i
							class="icon-pencil"></i> 添加类型</a></li>
							
                </ul>
              </div>
        </div>
	
		<div class="span10">
			<ul class="breadcrumb">
				<li><a href="{{ URL::to('admin') }}">首页</a> <span class="divider">/</span></li>
				<li><a href="{{ URL::to('admin/posttype') }}">日志类型</a> <span class="divider">/</span></li>
				<li class="active">类型列表</li>
			</ul>
<!-- will be used to show any messages -->
@if (Session::has('message'))
	<div class="alert alert-info" >
	<button type="button" class="close" data-dismiss="alert">×</button>
	{{ Session::get('message') }}
	</div>
@endif

            <table class="table">
              <thead>
                <tr>
                  <th>ID</th>
                  <th>日志类型</th>
                  <th>关键字</th>
                  <th>创建时间</th>
                  <th>更新时间</th>
                  <th>操作</th>
                </tr>
              </thead>
              <tbody>
              
              @foreach ($posttype as $type)
                <tr>
                  <td>{{$type->id}}</td>
                  <td>{{$type->pname}}</td>
                  <td>{{$type->keywords}}</td>
                  
                  <td>{{$type->created_at}}</td>
                  <td>{{$type->updated_at}}</td>
                  <td>
                {{ Form::open(array('url' => 'admin/posttype/' . $type->id, 'class' => 'pull-right')) }}
                	{{ Form::hidden('_method', 'DELETE') }}
                	{{ Form::submit('删除', ['class' => 'btn btn-warning', 'onclick' => 'return confirm("确定删除么？")']) }}
                {{ Form::close() }}
                  
				<!-- edit this nerd (uses the edit method found at GET /nerds/{id}/edit -->
				<a class="btn btn-small btn-info" href="{{ URL::to('admin/posttype/' . $type->id . '/edit') }}">编辑</a>
                  
                  </td>
                </tr>
              @endforeach
              
                <tr>
                  <td colspan="100">{{$posttype->links()}}</td>
                </tr>
              </tbody>
            </table>

		</div>

	</div>
</div>
@stop

